<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>校园学生住宿管理-管理员登录</title>
    <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-100">
<div class="min-h-screen flex items-center justify-center">
    <div class="w-full max-w-sm bg-white p-8 rounded-xl shadow-md">
        <h2 class="text-2xl font-semibold text-center text-gray-800 mb-6">管理员登录</h2>
        <form action="adminLogin" method="post" th:object="${adminLoginForm}" class="space-y-4">
            <div class="mb-4">
                <label class="block text-gray-700 text-sm font-medium mb-2" for="username">
                    用户名
                </label>
                <input
                        id="username"
                        name="username"
                        th:field="*{username}"
                        type="text"
                        placeholder="请输入用户名"
                        class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
                />
            </div>
            <div class="mb-6">
                <label class="block text-gray-700 text-sm font-medium mb-2" for="password">
                    密码
                </label>
                <input
                        id="password"
                        type="password"
                        name="password"
                        th:field="*{password}"
                        placeholder="请输入密码"
                        class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500"
                />
            </div>
            <div th:if="${loginError}" class="mb-4">
                <p th:text="${loginError}" class="text-red-500 text-sm"></p>
            </div>
            <div class="flex justify-between">
                <a href="/dormitory" class="text-blue-500 hover:text-blue-700 underline text-sm">
                    浏览宿舍
                </a>
                <a href="/login" class="text-blue-500 hover:text-blue-700 underline text-sm">
                    学生登录
                </a>
            </div>
            <button
                    type="submit"
                    class="w-full bg-blue-500 hover:bg-blue-600 text-white font-semibold py-2 px-4 rounded-lg transition duration-200"
            >
                登录
            </button>
        </form>
    </div>
</div>
</body>
</html>
